<?php

function runSQL($sql) {
    mysql_connect(DB_SERVER, DB_USER, DB_PASS) OR die('DB Error::Can\'t connect');
    mysql_select_db(DB_TABLE) OR die('DB Error::Can\'t select the table');
    mysql_query("SET NAMES 'utf8'");

    $res = mysql_query($sql);

    if (!$res)
        return false;
    else if (!is_resource($res) && $res)
        return true;
    else if (is_resource($res)) {
        while ($row = mysql_fetch_assoc($res)) {
            $result[] = $row;
        }
        return $result;
    }
}

?>
